﻿/************************************************************************

 This file is part of EscapeFromPrisonPlanet.

 EscapeFromPrisonPlanet is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 EscapeFromPrisonPlanet is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Foobar.  If not, see <http://www.gnu.org/licenses/>.

************************************************************************/

// All code (c)2012 Scott Bevin. all rights reserved

using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace LudumDare25Project
{
	internal class DebugDraw
	{
		public static DebugDraw Get = null;

#if DEBUG
		private List<string> debugTextList = new List<string>();
		private SpriteFont font;
#endif

		public DebugDraw(SpriteFont font)
		{
#if DEBUG
			this.font = font;
#endif
		}

		public void AddText(string text)
		{
#if DEBUG
			debugTextList.Add(text);
#endif
		}

		public void Render(SpriteBatch spriteBatch)
		{
#if DEBUG
			spriteBatch.Begin();

			Vector2 position = new Vector2(10.0f, 10.0f);

			foreach (string str in debugTextList)
			{
				spriteBatch.DrawString(
					font,
					str,
					position,
					Color.Green);

				position.Y += 11.0f;
			}

			spriteBatch.End();

			debugTextList.Clear();
#endif
		}
	}
}